<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {if condition="$is_home"}
    <title>{carefree:config name='site_name' /}</title>
    <meta name="keywords" content="{carefree:config name='seo_keywords' /}">
    <meta name="description" content="{carefree:config name='seo_description' /}">
    {else /}
    <title>{$title ?: '页面标题'} - {carefree:config name='site_name' /}</title>
    <meta name="keywords" content="{$keywords ?: ''}">
    <meta name="description" content="{$description ?: ''}">
    {/if}

    <!-- Bootstrap 5.3.3 CSS - 本地版本 -->
    <link href="/assets/css/bootstrap.min.css" rel="stylesheet">
    <!-- Bootstrap Icons - 本地版本 -->
    <link href="/assets/css/bootstrap-icons.min.css" rel="stylesheet">

    <!-- 自定义CSS -->
    <link rel="stylesheet" href="/assets/css/common.css">
    <link rel="stylesheet" href="/assets/css/layout.css">
    <link rel="stylesheet" href="/assets/css/comment.css">

    {block name="style"}{/block}
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg fixed-top">
        <div class="container">
            <a class="navbar-brand" href="/">{carefree:config name='site_name' /}</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link {if condition="$is_home"}active{/if}" href="/index.html">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/about.html">关于我们</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/features.html">产品功能</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/articles.html">新闻动态</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/contact.html">联系我们</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/members.html">会员中心</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/contribute.html">我要投稿</a>
                    </li>
                    <!-- 用户登录状态 -->
                    <li class="nav-item dropdown ms-lg-3" id="userDropdown" style="display: none;">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
                            <i class="bi bi-person-circle"></i> <span id="userName">用户</span>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="/profile.html"><i class="bi bi-person"></i> 个人中心</a></li>
                            <li><a class="dropdown-item" href="/notifications.html"><i class="bi bi-bell"></i> 我的通知 <span class="badge bg-danger ms-1" id="notificationBadge" style="display:none;"></span></a></li>
                            <li><a class="dropdown-item" href="/contributions.html"><i class="bi bi-file-text"></i> 我的投稿</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="/profile.html#favorites"><i class="bi bi-heart"></i> 我的收藏</a></li>
                            <li><a class="dropdown-item" href="/profile.html#comments"><i class="bi bi-chat"></i> 我的评论</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="#" id="logoutBtn"><i class="bi bi-box-arrow-right"></i> 退出登录</a></li>
                        </ul>
                    </li>
                    <li class="nav-item ms-lg-3" id="loginBtn">
                        <a class="btn btn-outline-primary btn-sm" href="/login.html">登录</a>
                    </li>
                    <li class="nav-item ms-lg-2" id="registerBtn">
                        <a class="btn btn-primary btn-sm" href="/register.html">注册</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- 主内容区 -->
    <main style="padding-top: 76px;">
        {block name="content"}{/block}
    </main>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="row">
                <div class="col-lg-4 mb-4">
                    <h5>{carefree:config name='site_name' /}</h5>
                    <p class="mb-4">{carefree:config name='seo_description' /}</p>
                    <div class="social-links">
                        <a href="#"><i class="bi bi-wechat"></i></a>
                        <a href="#"><i class="bi bi-qq"></i></a>
                        <a href="#"><i class="bi bi-github"></i></a>
                        <a href="#"><i class="bi bi-envelope"></i></a>
                    </div>
                </div>
                <div class="col-lg-2 col-md-6 mb-4">
                    <h5>产品</h5>
                    <a href="/features.html">功能特性</a>
                    <a href="/pricing.html">价格方案</a>
                    <a href="/demo.html">在线演示</a>
                    <a href="/download.html">下载中心</a>
                </div>
                <div class="col-lg-2 col-md-6 mb-4">
                    <h5>支持</h5>
                    <a href="/docs.html">帮助文档</a>
                    <a href="/faq.html">常见问题</a>
                    <a href="/contact.html">联系我们</a>
                    <a href="/support.html">技术支持</a>
                </div>
                <div class="col-lg-2 col-md-6 mb-4">
                    <h5>关于</h5>
                    <a href="/about.html">关于我们</a>
                    <a href="/team.html">团队介绍</a>
                    <a href="/partners.html">合作伙伴</a>
                    <a href="/careers.html">加入我们</a>
                </div>
                <div class="col-lg-2 col-md-6 mb-4">
                    <h5>法律</h5>
                    <a href="/terms.html">服务条款</a>
                    <a href="/privacy.html">隐私政策</a>
                    <a href="/license.html">许可协议</a>
                </div>
            </div>
            <div class="copyright">
                <p>{carefree:config name='site_copyright' /} |
                   <a href="https://beian.miit.gov.cn/" target="_blank" style="display: inline;">{carefree:config name='site_icp' /}</a>
                </p>
            </div>
        </div>
    </footer>

    <!-- 回到顶部按钮 -->
    <div class="back-to-top">
        <i class="bi bi-arrow-up"></i>
    </div>

    <!-- Bootstrap JS - 本地版本 -->
    <script src="/assets/js/bootstrap.bundle.min.js"></script>

    <!-- 自定义JS -->
    <script src="/assets/js/main.js"></script>
    <script src="/assets/js/auth.js"></script>

    {block name="script"}{/block}
</body>
</html>
